public class Test2 {
	public static void main(String[] args) {
		int num1 = 100;                                //定义整型变量num1
		int num2 = 80;                                 //定义整型变量num2
		int max = compareNumForMax(num1,num2);        //调用方法得出较大值
		int min = compareNumForMin(num1,num2);        //调用方法得出较小值
		System.out.println("max="+max+","+"min="+min);  //打印较大值和较小值	
	}
	public static int compareNumForMax(int a,int b){
		int c = 0;                      		     	//定义整型变量c
		c = (a>b)?a:b;  								//通过条件运算符来比较大小
		return c;      								//返回较大值
	}	
	public static int compareNumForMin(int a,int b){
		int c = 0;      								//定义整型变量c
		c = (a>b)?b:a;  								//通过条件运算符来比较大小
		return c;       								//返回较小值	
	}	
}